<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        ul{
            display: none;
            width: 200px;
            position:absolute;
            left:0;
            top:0;
            background-color:darkred;
        }
        li{
            list-style:none;
            height: 50px;
            margin-top:10px;
            font:16px/50px microsoft yahei;
        }
    </style>
</head>
<body>
<ul>
    <li>新建</li>
    <li>刷新</li>
    <li>文档</li>
    <li>分辨率</li>
    <li>初始化</li>
</ul>

<script>
    var oUl=document.getElementsByTagName("ul")[0];
    document.oncontextmenu=function(ev){
        ev=ev||event;
        oUl.style.display="block";
        oUl.style.left=ev.clientX-oUl.offsetWidth/2+"px";
        oUl.style.top=ev.clientY-oUl.offsetHeight/2+"px";
        return false;
    }
    oUl.onclick=function(ev){
        ev=ev||event;
        this.display="block";
        ev.cancelBubble=true;
    }
    document.onclick=function(){
        oUl.style.display="none";
    }
</script>
</body>
</html>